package china.nanjing.mychancellor.service;

import china.nanjing.mychancellor.config.FeignConfigurationKingdom;
import china.nanjing.mychancellor.service.hystrix.MilitaryServiceFeignHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Chen Hongyu
 */
// 不使用Zuul反向代理
//@FeignClient(value = "my-kingdom-client", url = "http://localhost:8300/my-kingdom")
// 使用Zuul反向代理
@FeignClient(value = "my-kingdom-client-2", url = "http://localhost:8202/my-kingdom/my-kingdom",
        fallback = MilitaryServiceFeignHystrix.class,
        configuration = {FeignConfigurationKingdom.class})
public interface MilitaryServiceFeign {

    @PostMapping(value = "/duchy_military_strength", produces = "application/json")
        // 参数多建议封装对象，然后用@RequestBody
    Object computeDuchyMilitaryStrengthById(@RequestParam(value = "duchy_id") Long duchyId);
}
